<template>
    <div id="member">
        <el-col :span="24" class="action-bar">
                <el-button type="primary" size="medium" @click="signatureVisible=true">添加</el-button>
            </el-col>
        <el-table
            :data="tableData"
            style="width: 100%">
            <el-table-column
                prop="date"
                label="名称"
                width="100"
                
                >
            </el-table-column>
            <el-table-column
                prop="date"
                label="排序"
                width="100"
                
                >
            </el-table-column>
            <el-table-column
                prop="name"
                label="创建"
                width="180">
            </el-table-column>
            <el-table-column label="操作" min-width='200'>
                <template slot-scope="scope">
                    <el-button  type="primary" @click="editReason(scope.row.id)">编辑</el-button>
                    <el-button  type="primary" @click="deletePeason(scope.row.id)">删除</el-button>
                </template>
            </el-table-column>
            
        </el-table>

		<el-dialog title="举报理由" :visible.sync="signatureVisible" @close="initData">
            <el-form>
                <el-form-item label="理由">
                    <el-input placeholder="请填写理由" v-model="name"></el-input>
                </el-form-item>
                <el-form-item label="排序">
                    <el-input placehoder="请填写排序" v-model="sortNum"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submit">提交</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
export default {
    name:'member',
    data() {
        return {
            signatureVisible:false,//查看个性签名弹窗状态
            searchText:'',

            tableData: [{}],
            page:1,
            totalPage:0,
            name:'',//理由
            sortNum:''//排序    
        }
    },
    methods: {
        search(){
            this.page=1;
            this.getUserAnswerList()
        },
        async getUserAnswerList(){
            //获取会员列表
            let params={
                page:this.page,
                limit:16,
            }
            let res=await this.$api.getUserAnswerList(
                params);
            if(res.data.level=='success'){
                this.tableData=res.data.data;
                this.totalPage=res.data.page_info.total;
            }
        },
        pageChange(e){
			//翻页
			this.page=e;
			this.getUserAnswerList();
        },
        initData(){
            this.reason='';
            this.sortNum=''
        },
        editReason(){
            //编辑
            this.signatureVisible=true
        },
        async deleteREason(){
            //删除
            let judge=null
            try {
              judge=  await this.$confirm('删除该理由?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning'
                })
            } catch (error) {
                judge='cancel'
            }
            console.log(judge)
        },
        submit(){

        }

    },
    mounted() {
        // this.getUserAnswerList()
    },
}
</script>
<style lang="scss" scoped>
    .action-bar{
			background-color: #f2f2f2;
			height: 60px;
			margin: 10px 0px;
			box-sizing: border-box;
			display: flex;
			align-items: center;
			padding-left: 20px;
			.action-bar-input{
				width: 250px;
				margin-right: 14px;
      }
      .task-form-text{
				color: #666666;
			}
		}
		.el-table-style{
			width: 100%;
			border: 1px solid #f2f2f2;
		}
		.footer-bar{
			display: flex;
			justify-content: space-between;
			align-items: center;
			background: #f2f2f2;
			padding: 8px;
			margin: 10px 0px;
			box-sizing: border-box;
		}
		.dialog-footer{
			text-align: center;
		}
		.executorList{
			display: flex;
			flex-wrap: wrap;
			div{
				margin:10px;
				border:1px solid #eee;
				border-radius: 5px;
				padding:5px 10px;
			}
		}
</style>